﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using JLL.China.Web.Areas.Listings.Models;
using JLL.China.Web.Libraries;
namespace JLL.China.Web.Areas.Listings.Controllers
{
    public class ProjectDirectoryIntController : ProjectDirectoryController
    {
        public ProjectDirectoryIntController()
        {
            ViewData["now_controller"] = "Listings/ProjectDirectoryInt/";
            ViewData["ActionPost"] = "ProjectDirectoryInt";
            ViewData["controller"] = "ProjectDirectoryInt";
            ViewData["ListingType"] = "Project";
            ViewData["IsLocal"] = "INTERNATIONAL";
            ViewData["ListingSource"] = "Admin";
            ViewData["HeadingMsgStep1"] = " Project Directory International - Basic Details ";
            ViewData["HeadingMsgStep2"] = " Project Directory International - Project Detail ";
            ViewData["HeadingMsgStep3"] = " Project Directory International - Features & Facilities ";
            ViewData["HeadingMsgStep4"] = " Project Directory International - Map ";
            ViewData["HeadingMsgStep5"] = " Project Directory International - Media ";
            ViewData["HeadingMsgStep6"] = " Project Directory International - Floor plan ";
        }
        public ActionResult Index(int? id, int? page)
        {
            /**********VIEW MESSAGE**********/
            ViewData["ActiveMsg"] = "Active Project Directory International";
            ViewData["DraftMsg"] = "Draft Project Directory International";
            ViewData["DeletedMsg"] = "Deleted Project Directory International";
            ViewData["AllMsg"] = "All Project Directory International";
            /********************/
            if (Session["page_size_default"] != null)
            {
                ViewData["per-page"] = Session["page_size_default"].ToString();
                defaultPageSize = Int32.Parse(Session["page_size_default"].ToString());
            }
            else
            {
                ViewData["per-page"] = defaultPageSize;
            }
            int currentPageIndex = page.HasValue ? page.Value : 1;
            //Strore Session
          
            Session["pageindex"] = currentPageIndex;
            if (id != null)
            {
                ViewData["ListStatus"] = id.ToString();
            }
            else
            {
                id = null;
                ViewData["ListStatus"] = 0;
            }
            var property = new JLL.China.Web.Areas.Listings.Models.ProjectDirectoryModel();

            var model = property.GetInternationalByStatus(id).ToPagedList(currentPageIndex, defaultPageSize);

            return View("../ProjectDirectory/Index", model);
        }
    }
}
